home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / lagoonquest.swf / scripts / frame_21 / DoAction.as
Text File  |  2007-09-27  |  20KB  |  731 lines

  1. function updateAction()
  2. {
  3.    keyLeft = Key.isDown(37);
  4.    keyRight = Key.isDown(39);
  5.    keyup = Key.isDown(38);
  6.    keydown = Key.isDown(40);
  7.    if(dolphinchar.state != "splash")
  8.    {
  9.       if(keyRight)
  10.       {
  11.          speed += trust;
  12.          if(!keyup && !keydown && dolphinchar.state != "hit")
  13.          {
  14.             dolphinchar.gotoAndStop("swim");
  15.          }
  16.       }
  17.       if(keyLeft)
  18.       {
  19.          speed -= trust2;
  20.       }
  21.       speed *= decay;
  22.       dolphinchar._x = Math.round(initX + speed * 9);
  23.       if(keyup)
  24.       {
  25.          if(dolphinchar.state != "hit")
  26.          {
  27.             dolphinchar.gotoAndStop("monte");
  28.          }
  29.          if(hspeed > 0)
  30.          {
  31.             hspeed *= hdecay;
  32.          }
  33.          hspeed -= htrust;
  34.       }
  35.       if(keydown)
  36.       {
  37.          if(dolphinchar.state != "hit")
  38.          {
  39.             dolphinchar.gotoAndStop("plonge");
  40.          }
  41.          if(hspeed < 0)
  42.          {
  43.             hspeed *= hdecay;
  44.          }
  45.          hspeed += htrust;
  46.       }
  47.       if(!keyup && !keydown)
  48.       {
  49.          hspeed *= hdecay2;
  50.          if(!keyRight && !keyLeft && dolphinchar.state != "hit")
  51.          {
  52.             speed >= 3 ? dolphinchar.gotoAndStop("slow") : dolphinchar.gotoAndStop("idle");
  53.          }
  54.       }
  55.       if(y < 75)
  56.       {
  57.          !(hspeed < -2.5 && animJumpAvlbl) ? (hspeed = 3) : dolphinchar.gotoAndStop("splash");
  58.       }
  59.       y += hspeed;
  60.       dolphinchar._y = y;
  61.    }
  62.    if(pearlActivated)
  63.    {
  64.       pearlTimer--;
  65.       if(pearlTimer <= 0)
  66.       {
  67.          pearlActivated = false;
  68.          pearlTimer = 180;
  69.          trust = 0.7;
  70.       }
  71.    }
  72.    drawFront();
  73.    drawBack();
  74.    checkUpcomingEvents();
  75. }
  76. function checkHitOnHitzone(newHitzone)
  77. {
  78.    if(newHitzone.hitTest(dolphinchar.hitzone) && dolphinchar.state != "hit")
  79.    {
  80.       dolphinchar.gotoAndStop("hit");
  81.       lifeMeter.meter.nextFrame();
  82.    }
  83. }
  84. function sendPearl()
  85. {
  86.    pearlType = ++pearlType % 2;
  87.    pearl.gotoAndStop(pearlType + 2);
  88.    pearl.pearl.gotoAndPlay(1);
  89.    pearl._x = 525;
  90.    pearl._y = 85 + random(50);
  91. }
  92. function checkPearl()
  93. {
  94.    adjustElementSpeed(pearl);
  95.    if(pearl.hitTest(dolphinchar.hitzone) && pearl.pearl._currentframe < 24)
  96.    {
  97.       if(pearlType == 0)
  98.       {
  99.          fx.gotoAndPlay("pearl");
  100.          trust = 1.1;
  101.          lifeMeter.score += 500;
  102.       }
  103.       else
  104.       {
  105.          fx.gotoAndPlay("pearlBad");
  106.          trust = 0.3;
  107.          lifeMeter.score -= 500;
  108.       }
  109.       pearlActivated = true;
  110.       pearl.pearl.gotoAndPlay("die");
  111.    }
  112. }
  113. function checkMeduseAI()
  114. {
  115.    adjustElementSpeed(enemyContainOvr);
  116.    var i = 1;
  117.    while(i < 4)
  118.    {
  119.       var eTarget = eval("enemyContainOvr.meduse.md" + i);
  120.       var toMoveX = eTarget.xToMove - eTarget._x;
  121.       if(toMoveX < -5 || toMoveX > 5)
  122.       {
  123.          eTarget._x += toMoveX / 5;
  124.       }
  125.       else
  126.       {
  127.          eTarget.xToMove = Math.round(eTarget._x + random(50) - 30);
  128.       }
  129.       var toMoveY = eTarget.yToMove - eTarget._y;
  130.       if(toMoveY < -5 || toMoveY > 5)
  131.       {
  132.          eTarget._y <= -25 ? (eTarget.yToMove += 25) : (eTarget._y += toMoveY / 10);
  133.       }
  134.       else
  135.       {
  136.          eTarget.yToMove = Math.round(eTarget._y + random(30) - 15);
  137.       }
  138.       checkHitOnHitzone(eTarget);
  139.       i++;
  140.    }
  141. }
  142. function checkPufferAI()
  143. {
  144.    adjustElementSpeed(enemyContainOvr);
  145.    var i = 1;
  146.    while(i < 9)
  147.    {
  148.       var eTarget = eval("enemyContainOvr.puffer.puffer" + i);
  149.       checkHitOnHitzone(eTarget);
  150.       i++;
  151.    }
  152. }
  153. function checkOil()
  154. {
  155.    adjustElementSpeed(enemyContainOvr);
  156.    if(enemyContainOvr.oil.hitzone.hitTest(dolphinchar._x,dolphinchar._y,true))
  157.    {
  158.       oilTimer--;
  159.       speed *= 0.6;
  160.       hspeed *= 0.6;
  161.       if(oilTimer <= 0 && dolphinchar.state != "hit")
  162.       {
  163.          oilTimer = 45;
  164.          dolphinchar.gotoAndStop("hit");
  165.          lifeMeter.meter.nextFrame();
  166.       }
  167.    }
  168. }
  169. function checkFishingBoat()
  170. {
  171.    adjustElementSpeed(enemyContain);
  172.    var i = 1;
  173.    while(i < 4)
  174.    {
  175.       var eTarget = eval("enemyContain.fishing.fishman" + i);
  176.       checkHitOnHitzone(eTarget.lure);
  177.       checkHitOnHitzone(eTarget.line);
  178.       i++;
  179.    }
  180. }
  181. function checkGiantBoat()
  182. {
  183.    adjustElementSpeed(enemyContainOvr);
  184.    var _loc1_ = enemyContainOvr.giantBoat;
  185.    if(_loc1_.helix.hitzone.hitTest(dolphinchar.hitzone) || _loc1_.hitzone1.hitTest(dolphinchar.hitzone))
  186.    {
  187.       if(dolphinchar.state != "hit")
  188.       {
  189.          dolphinchar.gotoAndStop("hit");
  190.          lifeMeter.health.nextFrame();
  191.       }
  192.       speed -= 0.8;
  193.    }
  194.    if(_loc1_.hitzone2.hitTest(dolphinchar.hitzone))
  195.    {
  196.       dolphinchar.gotoAndStop("hit");
  197.       lifeMeter.health.nextFrame();
  198.       hspeed = 3;
  199.    }
  200. }
  201. function checkBuoysJump()
  202. {
  203.    var _loc1_ = new Object();
  204.    _loc1_.x = spawnPntFgnd.spawnPoint._x;
  205.    _loc1_.y = spawnPntFgnd.spawnPoint._y;
  206.    spawnPntFgnd.localToGlobal(_loc1_);
  207.    enemyContain._x = _loc1_.x;
  208.    enemyContain._y = _loc1_.y;
  209.    buoysOver1._x = enemyContain._x + enemyContain.buoysJump.front._x;
  210.    buoysOver1._y = enemyContain._y + enemyContain.buoysJump.front._y;
  211.    if(enemyContain.buoysJump.hitzone.hitTest(dolphinchar))
  212.    {
  213.       if(enemyContain.buoysJump.sparkle._currentframe == 1)
  214.       {
  215.          lifeMeter.score += 5685;
  216.          enemyContain.buoysJump.sparkle.gotoAndPlay(2);
  217.       }
  218.    }
  219. }
  220. function checkBuoys()
  221. {
  222.    adjustElementSpeed(enemyContain);
  223.    var j = 0;
  224.    for(var i in enemyContain.buoys)
  225.    {
  226.       j++;
  227.       var buoyVar = eval("enemyContain.buoys.buoys" + j);
  228.       var buoyOverVar = eval("buoysOver" + j);
  229.       buoyOverVar._x = enemyContain._x + buoyVar._x + buoyVar.front._x;
  230.       buoyOverVar._y = enemyContain._y + buoyVar._y + buoyVar.front._y;
  231.       if(dolphinchar.hitzone.hitTest(buoyVar.hitzone1) || dolphinchar.hitTest(buoyVar.hitzone2))
  232.       {
  233.          speed -= 0.8;
  234.       }
  235.       if(dolphinchar.hitzone.hitTest(buoyVar.hitzone3))
  236.       {
  237.          if(buoyVar.sparkle._currentframe == 1)
  238.          {
  239.             lifeMeter.score += 4859;
  240.             buoyVar.sparkle.gotoAndPlay(2);
  241.          }
  242.       }
  243.       if(bossShark.hitzone.hitTest(buoyVar.hitzone3))
  244.       {
  245.          buoyOverVar._visible = buoyVar._visible = false;
  246.          bossShark.gotoAndStop("jammed");
  247.       }
  248.    }
  249. }
  250. function resetBuoys()
  251. {
  252.    var j = 0;
  253.    for(var i in enemyContain.buoys)
  254.    {
  255.       j++;
  256.       var buoyVar = eval("enemyContain.buoys.buoys" + j);
  257.       var buoyOverVar = eval("buoysOver" + j);
  258.       buoyOverVar._visible = buoyVar._visible = true;
  259.    }
  260. }
  261. function checkBossSharkAI()
  262. {
  263.    if(bossShark.state != "jammed")
  264.    {
  265.       var _loc1_ = Math.round((dolphinchar._y - bossShark._y) / 15);
  266.       bossShark._y += _loc1_;
  267.       bossShark._x += bossSharkSpeed;
  268.       if(bossShark._x > 120)
  269.       {
  270.          bossSharkSpeed = -1.6;
  271.       }
  272.       else if(bossShark._x < 40)
  273.       {
  274.          bossSharkSpeed = 1.6;
  275.       }
  276.       if(bossAtckFreq < 120)
  277.       {
  278.          bossAtckFreq++;
  279.       }
  280.       else if(bossShark.state != "attack" && bossSharkActive)
  281.       {
  282.          bossAtckFreq = 0;
  283.          bossShark.gotoAndPlay("attack");
  284.       }
  285.       checkHitOnHitzone(bossShark);
  286.    }
  287.    else
  288.    {
  289.       adjustElementSpeed(bossShark);
  290.    }
  291. }
  292. function checkOursins()
  293. {
  294.    adjustElementSpeed(oursins);
  295.    if(oursins._x > -400)
  296.    {
  297.       var i = 1;
  298.       while(i < 5)
  299.       {
  300.          var eTarget = eval("oursins.oursin" + i);
  301.          checkHitOnHitzone(eTarget.oursin);
  302.          checkHitOnHitzone(eTarget.oursin.spike1);
  303.          checkHitOnHitzone(eTarget.oursin.spike2);
  304.          checkHitOnHitzone(eTarget.oursin.spike3);
  305.          i++;
  306.       }
  307.    }
  308.    else
  309.    {
  310.       muteOursins();
  311.    }
  312. }
  313. function sendOursins()
  314. {
  315.    oursins._x = 600;
  316.    var i = 1;
  317.    while(i < 5)
  318.    {
  319.       var eTarget = eval("oursins.oursin" + i);
  320.       var frameRandom = random(15) + 2;
  321.       eTarget.gotoAndPlay(frameRandom);
  322.       i++;
  323.    }
  324. }
  325. function muteOursins()
  326. {
  327.    var i = 1;
  328.    while(i < 5)
  329.    {
  330.       var eTarget = eval("oursins.oursin" + i);
  331.       eTarget.gotoAndStop(1);
  332.       i++;
  333.    }
  334. }
  335. function sendEnemyContain(container, enemyToSend, height)
  336. {
  337.    var newContainer = eval(container);
  338.    newContainer._x = 600;
  339.    newContainer._y = height;
  340.    newContainer.gotoAndStop(enemyToSend);
  341. }
  342. function adjustElementSpeed(element)
  343. {
  344.    if(speed >= 0)
  345.    {
  346.       element._x -= speed;
  347.    }
  348. }
  349. function drawBack()
  350. {
  351.    if(speed >= 0)
  352.    {
  353.       back.back._x -= speed / 5;
  354.    }
  355.    for(var i in backArray)
  356.    {
  357.       var targetBack = eval(backArray[i]);
  358.       var xDist = back.back._x + targetBack._x - dolphinchar._x;
  359.       if(xDist < -950)
  360.       {
  361.          var targetBack2 = i != 1 ? eval(back.back.bg2) : eval(back.back.bg1);
  362.          targetBack._x = targetBack2._width + targetBack2._x - 20;
  363.       }
  364.    }
  365. }
  366. function drawFront()
  367. {
  368.    adjustElementSpeed(front);
  369.    for(var i in fgndArray)
  370.    {
  371.       var targetFgnd = eval(fgndArray[i]);
  372.       if(targetFgnd.fgnd.hitTest(dolphinchar._x,dolphinchar._y,true) && dolphinchar.state != "splash" && dolphinchar.state != "hit")
  373.       {
  374.          dolphinchar.gotoAndStop("hit");
  375.          lifeMeter.meter.nextFrame();
  376.          speed -= 0.8;
  377.          hspeed = -3;
  378.       }
  379.       var xDist = front._x + targetFgnd._x - dolphinchar._x;
  380.       if(xDist < -750)
  381.       {
  382.          var targetFgnd2 = i != 1 ? eval(front.fgnd_2) : eval(front.fgnd_1);
  383.          targetFgnd._x = targetFgnd2._width + targetFgnd2._x - 10;
  384.          if(changeInFgnd)
  385.          {
  386.             if(spawnPntFgnd == undefined)
  387.             {
  388.                spawnPntFgnd = targetFgnd;
  389.                targetFgnd.gotoAndStop(fgndToShow);
  390.                changeInFgnd = false;
  391.             }
  392.             else if(targetFgnd == spawnPntFgnd)
  393.             {
  394.                spawnPntFgnd.gotoAndStop(1);
  395.                delete spawnPntFgnd;
  396.                delete fgndToShow;
  397.                changeInFgnd = false;
  398.             }
  399.          }
  400.       }
  401.    }
  402. }
  403. function checkUpcomingEvents()
  404. {
  405.    var _loc1_ = levelArray[0];
  406.    switch(_loc1_)
  407.    {
  408.       case "start":
  409.          sendEnemyContain("enemyContain","borneStart",50);
  410.          levelArray.shift();
  411.          break;
  412.       case "borneStart":
  413.          adjustElementSpeed(enemyContain);
  414.          if(enemyContain._x < -300)
  415.          {
  416.             bossShark.gotoAndPlay("intro");
  417.             sendEnemyContain("enemyContainOvr","meduse",150);
  418.             levelArray.shift();
  419.          }
  420.          break;
  421.       case "meduse":
  422.          checkBossSharkAI();
  423.          checkMeduseAI();
  424.          if(enemyContainOvr._x < -600)
  425.          {
  426.             sendPearl();
  427.             sendEnemyContain("enemyContainOvr","puffer",120);
  428.             levelArray.shift();
  429.          }
  430.          break;
  431.       case "puffer":
  432.          checkPearl();
  433.          checkBossSharkAI();
  434.          checkPufferAI();
  435.          if(enemyContainOvr._x < -600)
  436.          {
  437.             bossSharkActive = false;
  438.             sendEnemyContain("enemyContain","buoys",175);
  439.             levelArray.shift();
  440.          }
  441.          break;
  442.       case "buoys":
  443.          checkPearl();
  444.          checkBossSharkAI();
  445.          checkBuoys();
  446.          if(enemyContain._x < -300)
  447.          {
  448.             bossShark.state = "jammed";
  449.             sendOursins();
  450.             changeInFgnd = true;
  451.             fgndToShow = 2;
  452.             resetBuoys();
  453.             levelArray.shift();
  454.          }
  455.          break;
  456.       case "waitForChange":
  457.          checkBossSharkAI();
  458.          checkOursins();
  459.          if(!changeInFgnd)
  460.          {
  461.             bossShark._visible = false;
  462.             sendEnemyContain("enemyContain","buoysJump",50);
  463.             levelArray.shift();
  464.          }
  465.          break;
  466.       case "buoysJump":
  467.          checkBossSharkAI();
  468.          checkBuoysJump();
  469.          checkOursins();
  470.          changeInFgnd = true;
  471.          if(spawnPntFgnd == undefined)
  472.          {
  473.             changeInFgnd = false;
  474.             sendEnemyContain("enemyContain","fishingBoat",80);
  475.             levelArray.shift();
  476.          }
  477.          break;
  478.       case "fishingBoat":
  479.          checkFishingBoat();
  480.          if(enemyContain._x < -500)
  481.          {
  482.             animJumpAvlbl = false;
  483.             sendEnemyContain("enemyContainOvr","giantBoat",100);
  484.             levelArray.shift();
  485.          }
  486.          break;
  487.       case "giantBoat":
  488.          checkGiantBoat();
  489.          if(enemyContainOvr._x < -700)
  490.          {
  491.             animJumpAvlbl = _loc0_ = true;
  492.             bossShark._visible = _loc0_;
  493.             sendEnemyContain("enemyContainOvr","oil",110);
  494.             levelArray.shift();
  495.          }
  496.          break;
  497.       case "oil":
  498.          checkOil();
  499.          if(enemyContainOvr._x < -600)
  500.          {
  501.             sendPearl();
  502.             bossSharkActive = true;
  503.             bossShark._x = 100;
  504.             bossAtckFreq = 0;
  505.             bossShark.gotoAndPlay("intro");
  506.             sendEnemyContain("enemyContain","fishingBoat",80);
  507.             levelArray.shift();
  508.          }
  509.          break;
  510.       case "fishingBoat2":
  511.          checkPearl();
  512.          checkBossSharkAI();
  513.          checkFishingBoat();
  514.          if(enemyContain._x < -500)
  515.          {
  516.             sendEnemyContain("enemyContainOvr","puffer",150);
  517.             levelArray.shift();
  518.          }
  519.          break;
  520.       case "puffer2":
  521.          checkPearl();
  522.          checkBossSharkAI();
  523.          checkPufferAI();
  524.          if(enemyContainOvr._x < -600)
  525.          {
  526.             sendOursins();
  527.             sendEnemyContain("enemyContainOvr","meduse",150);
  528.             levelArray.shift();
  529.          }
  530.          break;
  531.       case "meduse2":
  532.          checkBossSharkAI();
  533.          checkMeduseAI();
  534.          checkOursins();
  535.          if(enemyContainOvr._x < -500)
  536.          {
  537.             bossSharkActive = false;
  538.             sendEnemyContain("enemyContain","buoys",150);
  539.             levelArray.shift();
  540.          }
  541.          break;
  542.       case "buoys2":
  543.          checkBossSharkAI();
  544.          checkBuoys();
  545.          checkOursins();
  546.          if(enemyContain._x < -300)
  547.          {
  548.             resetBuoys();
  549.             bossShark.state = "jammed";
  550.             changeInFgnd = true;
  551.             fgndToShow = 3;
  552.             levelArray.shift();
  553.          }
  554.          break;
  555.       case "waitForChange2":
  556.          checkOursins();
  557.          if(!changeInFgnd)
  558.          {
  559.             sendEnemyContain("enemyContain","buoysJump",50);
  560.             levelArray.shift();
  561.          }
  562.          break;
  563.       case "buoysJump2":
  564.          checkBuoysJump();
  565.          changeInFgnd = true;
  566.          if(spawnPntFgnd == undefined)
  567.          {
  568.             changeInFgnd = false;
  569.             sendEnemyContain("enemyContainOvr","puffer",150);
  570.             levelArray.shift();
  571.          }
  572.          break;
  573.       case "puffer3":
  574.          checkPufferAI();
  575.          if(enemyContainOvr._x < -600)
  576.          {
  577.             animJumpAvlbl = false;
  578.             sendEnemyContain("enemyContainOvr","giantBoat",100);
  579.             levelArray.shift();
  580.          }
  581.          break;
  582.       case "giantBoat2":
  583.          checkGiantBoat();
  584.          if(enemyContainOvr._x < -700)
  585.          {
  586.             animJumpAvlbl = true;
  587.             sendEnemyContain("enemyContain","fishingBoat",80);
  588.             sendEnemyContain("enemyContainOvr","oil",110);
  589.             levelArray.shift();
  590.          }
  591.          break;
  592.       case "oil2":
  593.          checkOil();
  594.          checkFishingBoat();
  595.          if(enemyContainOvr._x < -600)
  596.          {
  597.             sendEnemyContain("enemyContainOvr","meduse",150);
  598.             levelArray.shift();
  599.          }
  600.          break;
  601.       case "meduse3":
  602.          checkMeduseAI();
  603.          if(enemyContainOvr._x < -600)
  604.          {
  605.             sendOursins();
  606.             changeInFgnd = true;
  607.             fgndToShow = 2;
  608.             levelArray.shift();
  609.          }
  610.          break;
  611.       case "waitForChange3":
  612.          checkOursins();
  613.          if(!changeInFgnd)
  614.          {
  615.             sendEnemyContain("enemyContain","buoysJump",50);
  616.             levelArray.shift();
  617.          }
  618.          break;
  619.       case "buoysJump3":
  620.          checkOursins();
  621.          checkBuoysJump();
  622.          changeInFgnd = true;
  623.          if(spawnPntFgnd == undefined)
  624.          {
  625.             changeInFgnd = false;
  626.             sendEnemyContain("enemyContain","fishingBoat",80);
  627.             sendEnemyContain("enemyContainOvr","puffer",150);
  628.             levelArray.shift();
  629.          }
  630.          break;
  631.       case "puffer4":
  632.          checkFishingBoat();
  633.          checkPufferAI();
  634.          if(enemyContainOvr._x < -600)
  635.          {
  636.             sendOursins();
  637.             changeInFgnd = true;
  638.             fgndToShow = 3;
  639.             levelArray.shift();
  640.          }
  641.          break;
  642.       case "waitForChange4":
  643.          checkOursins();
  644.          if(!changeInFgnd)
  645.          {
  646.             sendEnemyContain("enemyContain","buoysJump",50);
  647.             levelArray.shift();
  648.          }
  649.          break;
  650.       case "buoysJump4":
  651.          checkOursins();
  652.          checkBuoysJump();
  653.          changeInFgnd = true;
  654.          if(spawnPntFgnd == undefined)
  655.          {
  656.             sendPearl();
  657.             changeInFgnd = false;
  658.             bossShark.gotoAndPlay("intro");
  659.             sendEnemyContain("enemyContainOvr","meduse",150);
  660.             levelArray.shift();
  661.          }
  662.          break;
  663.       case "meduse5":
  664.          checkPearl();
  665.          checkBossSharkAI();
  666.          checkMeduseAI();
  667.          if(enemyContainOvr._x < -600)
  668.          {
  669.             sendEnemyContain("enemyContain","fishingBoat",80);
  670.             sendEnemyContain("enemyContainOvr","puffer",120);
  671.             levelArray.shift();
  672.          }
  673.          break;
  674.       case "puffer5":
  675.          checkPearl();
  676.          checkBossSharkAI();
  677.          checkFishingBoat();
  678.          checkPufferAI();
  679.          if(enemyContainOvr._x < -600)
  680.          {
  681.             sendEnemyContain("enemyContain","buoys2",175);
  682.             levelArray.shift();
  683.          }
  684.          break;
  685.       case "buoys3":
  686.          checkBossSharkAI();
  687.          checkBuoys();
  688.          if(enemyContain._x < -300)
  689.          {
  690.             sendOursins();
  691.             resetBuoys();
  692.             bossShark.state = "jammed";
  693.             changeInFgnd = true;
  694.             fgndToShow = 2;
  695.             levelArray.shift();
  696.          }
  697.          break;
  698.       case "waitForChange5":
  699.          checkBossSharkAI();
  700.          checkOursins();
  701.          if(!changeInFgnd)
  702.          {
  703.             sendEnemyContain("enemyContain","buoysJump",50);
  704.             levelArray.shift();
  705.          }
  706.          break;
  707.       case "buoysJump5":
  708.          checkBossSharkAI();
  709.          checkBuoysJump();
  710.          checkOursins();
  711.          changeInFgnd = true;
  712.          if(spawnPntFgnd == undefined)
  713.          {
  714.             changeInFgnd = false;
  715.             sendEnemyContain("enemyContain","borneEnd",50);
  716.             levelArray.shift();
  717.          }
  718.          break;
  719.       case "borneEnd":
  720.          adjustElementSpeed(enemyContain);
  721.          if(enemyContain._x < -300)
  722.          {
  723.             finalScore = lifeMeter.score;
  724.             dolphinchar.gotoAndStop("victory");
  725.          }
  726.    }
  727. }
  728. _global.dolphinGame = this;
  729. _quality = "MEDIUM";
  730. _focusrect = false;
  731.